import axios from 'axios'
// let baseURL = 'http://www.chensunmoon.cn/ghost/api/v0.1/'
const http = axios.create({
  baseURL: 'ghost/api/v0.1/',
  timeout: 10000
})
http.interceptors.response.use((response) => {
  return response.data
}, (error) => {
  return Promise.reject(error)
})
http.interceptors.request.use((request) => {
  if (!request.params) {
    request.params = {}
  }
  request.params['client_id'] = 'ghost-frontend'
  request.params['client_secret'] = '59c5e11e0453'
  return request
})

export default http
